package com.jsgt.greekfire.common.http

import com.jsgt.greekfire.bean.*
import com.jsgt.greekfire.ui.mine.sermoncommunity.Community
import okhttp3.RequestBody
import retrofit2.http.*

/**
 * author fhx
 * create time 2020/4/25 18:11
 **/
interface CoinService {
    /**
     * 获取我的行情列表
     */
    @POST("api/gfcmymarket/list")
    suspend fun getMyMarketList(@Body params: RequestBody): ResponseData<List<CoinBean>>

    /**
     * 行情列表
     * http://8.129.176.199:9081/api/apinotoken/marketprice/all
     */
//    @POST("api/gfcmarket/list")
    @GET("apinotoken/marketprice/all")
    suspend fun getMarketList(): ResponseData<List<CoinBean>>

    /**
     * 行情详情
     */
    @GET("api/gfcmarket/info/{guid}")
    suspend fun getMarketInfo(@Path("guid") guid: String): ResponseData<CoinBean>

    /**
     * 添加自选
     */
    @POST("api/gfcmymarket/save")
    suspend fun addSelfMarket(@Body params: RequestBody): ResponseData<CoinBean>

    /**
     * 通过币名称获取行情
     */
    @POST("api/gfcmarket/info/name/GFC")
    suspend fun getMarketInfoByName(): ResponseData<CoinBean>

    /**
     * 我的行情自选
     */
    @POST("api/gfcmymarket/info")
    suspend fun getMySelfMarketInfo(@Body params: RequestBody): ResponseData<CoinBean>

    /**
     * 删除我的自选
     */
    @POST("api/gfcmymarket/deleteMe")
    suspend fun deleteMyMarket(@Body params: RequestBody): ResponseData<CoinBean>

    /**
     * 充币地址
     */
    @POST("api/gfcuserasset/getRechargeAddr")
    suspend fun rechargeAddress(@Body params: RequestBody): ResponseData<RechargeAddressBean>

    /**
     * 个人充币地址
     */
    @GET("api/chargeaddress/info")
    suspend fun getRechargeAddress(): ResponseData<RechargeAddress>

    /**
     * 抢购列表
     */
    @GET("api/gfcpanicbuyconfig/list")
    suspend fun snappedUpCoinList(): ResponseData<List<SnapUpBean>>

    /**
     * 抢购
     */
    @POST("api/gfcuserasset/panicbuy")
    suspend fun snappedUpCoin(@Body params: RequestBody): ResponseData<Any>

    /**
     * 推荐币种
     */
    @GET("api/gfcassettype/queryList")
    suspend fun coinTypeList(): ResponseData<List<CoinBean>>

    /**
     * 提币
     */
    @POST("api/gfcwithdrawalorder/save")
    suspend fun withdrawCoin(@Body params: RequestBody): ResponseData<Any>

    /**
     * 买卖币
     */
    @POST("api/gfcotcadvertise/save")
    suspend fun sellCoin(@Body params: RequestBody): ResponseData<Any>

    /**
     * 出售列表
     */
    @GET("api/gfcotcadvertise/saleList")
    suspend fun saleCoinList(): ResponseData<List<CoinBean>>

    /**
     * 买币
     */
    @POST("api/gfcotcorder/buyCoin")
    suspend fun buyCoin(@Body params: RequestBody): ResponseData<Any>

    /**
     * 转账
     */
    @POST("api/gfctransferactivation/transferToAddr")
    suspend fun transferToAddress(@Body params: RequestBody): ResponseData<Any>

    /**
     * 资产管理coin状态更新
     */
    @POST("api/gfcuserasset/update")
    suspend fun userAssetUpdate(@Body params: RequestBody): ResponseData<Any>

    /**
     * 转入转出
     */
    @POST("api/gfcuserasset/inAndOut")
    suspend fun rollInOrOut(@Body params: RequestBody): ResponseData<Any>

    /**
     * 获取管理费列表
     */
    @GET("api/gfcservicecharges/getByAssetId/{guid}")
    suspend fun getManagerCharge(@Path("guid") guid: String): ResponseData<List<ManageBean>>

    /**
     * 划转
     */
    @POST("api/gfcuserasset/convert")
    suspend fun exchange(@Body params: RequestBody): ResponseData<Any>

    /**
     * usdt兑换GFC
     * gfcAmount
     * ustdAmount
     * tradingPassword  MD5
     */
    @POST("api/gfcuserasset/utogfc")
    suspend fun u2GFC(@Body params: RequestBody): ResponseData<Any>

    /**
     * 交易涨跌列表
     */
    @POST("api/gfcotcadvertise/saleList")
    suspend fun saleList(@Body params: RequestBody): ResponseData<List<CoinBean>>

    /**
     * 取消挂单
     */
    @POST("api/gfcotcadvertise/update")
    suspend fun cancelOrder(@Body params: RequestBody): ResponseData<Any>

    /**
     * 收益记录
     */
    @POST("api/gfcawardlog/list")
    suspend fun getIncomeList(@Body params: RequestBody): ResponseData<ResultData<IncomeRecordBean>>

    /**
     * 获取USTD换算比例
     */
    @GET("api/gfcmarket/getUsdtPrice")
    suspend fun getUstdPrice(): PriceBean

    /**
     * 抢购限制
     */
    @POST("api/gfcpanicbuylog/residueAmount")
    suspend fun residueAmount(@Body params: RequestBody): ResponseData<Double>

    /**
     * 创建区块检查相关状态
     */
    @GET("api/gfcparticipation/checkParticipation")
    suspend fun checkGenesisBlock(): ResponseData<GenesisBlockStatusBean>


    /**
     * 创世区块配置中的状态
     */
    @GET("api/gfusergenesisblock/info")
    suspend fun checkGenesisBlockStatus(): ResponseData<BlockStatus>


    /**
     * 用户参与 创世区块 抢购
     */
    @POST("api/gfusergenesisblock/participate")
    suspend fun checkGenesisBlockparticipate(@Body params: RequestBody): ResponseData<Any>


    /**
     * 参与创世区块
     */
    @GET("api/gfcparticipation/save")
    suspend fun joinGenesisBlock(): ResponseData<Any>

    /**
     * 布道社区
     * api/userperformance/myCommunity
     */
    @POST("api/userperformance/myCommunity")
    suspend fun myCommunity(@Body params: RequestBody): ResponseData<Community>


    /**
     * 用户闪兑接口
     * http://ip:8081/greekfire/api/gfcuserasset/convert
     */
    @POST("api/gfcuserasset/convert")
    suspend fun convert(@Body params: RequestBody): ResponseData<Any>

    /**
     *  转入
     */
    @POST("api/gfcuserasset/poolIn")
    suspend fun poolIn(@Body params: RequestBody): ResponseData<Any>

    /**
     *  转出
     */
    @POST("api/gfcuserasset/poolOut ")
    suspend fun poolOut (@Body params: RequestBody): ResponseData<Any>
    /**
     *  兑换配置列表
     */
    @GET("api/gfcuserasset/convertConfigList")
    suspend fun convertConfigList (): ResponseData<List<ConvertConfigBean>>
    /**
     *  兑换
     */
    @POST("api/gfcuserasset/convertCoin")
    suspend fun convertCoin (@Body params: RequestBody): ResponseData<Any>
}